export default {
    data() {
        return {
            //列表
            list:[],
        }
    },
    created() {
        this.getList()
    },
    methods: {
        //获取列表数据
        async getList(){
            try {
                console.log(this.urls.list,'asd')
                let { url,sync } = this.urls.list
                console.log(this.urls,url,'urls')

                if(url){
                    console.log(url,'url')

                    if(sync){
                        console.log(sync,'sync')

                        let res = await url()
                        this.list = res.data||[]||{};
                    }else{
                        console.log(sync,'sync')

                        url().then(res=>{
                            this.list = res.data||[]||{};
                        });
                    }
                }
            } catch (error) {
                
            }
            
            
        },
        toPage(id,path,key){
            let paths = {
                path:path,
                query:{}
            }
            if(key){
                paths.query[key] = id
            }
            console.log(paths,'paths')
            // this.$route.push
            // this.$router.push
            this.$router.push(paths)
        }
    }
}